
var treePanel = new Ext.tree.TreePanel({
	region: 'west',	  	//布局
	rootVisible:false,	//控制是否显示树根节点
    autoScroll: true, 	//自动滚动条
    useArrows:true,  	//是否在树中使用Vista样式箭头，默认为false。
    animate:true,		//展开,收缩动画,false时,则没有动画效果 
    width:250,
    title:'例子列表',
    root:new Ext.tree.AsyncTreeNode({
        id: '0', 
        text: '所有类别',
        iconCls:'test',
        expanded: true 
    }),
    loader: new Ext.tree.TreeLoader({
     	url : 'getTreeData.do',
     	baseParams: {type:'getDemoTree'}
	}),
	tbar:[' ',
		new Ext.form.TextField({
			width: 150,
			emptyText:'要查找的例子',
            enableKeyEvents: true,
			listeners:{
				render: function(f){
                	this.filter = new Ext.tree.TreeFilter(this, {
                		clearBlank: true,
                		autoClear: true
                	});
				},
                keydown: {
                    fn: this.filterTree,
                    buffer: 350,
                    scope: this
                },
                scope: this
			}
		}), '->',{
            iconCls: 'icon-expand-all',
			tooltip: '展开全部',
            handler: function(){ treePanel.root.expand(true); },
            scope: this
      	},'-',{
            iconCls: 'icon-collapse-all',
            tooltip: '收缩全部',
            handler: function(){ treePanel.root.collapse(true); },
            scope: this
      	} ,' '
	]
});